const crypto = require("crypto")
const { CRYPTO_SECERT } = require('../conf/constants')


/**
 * 
 * @param {string} content 明文
 */
function _md5(content) {
    const md5 = crypto.createHash('md5')
    return md5.update(content).digest('hex')
}

function pwdCrypto(content) {
    const str = `password=${content}&key=${CRYPTO_SECERT}`
    return _md5(str)
}

module.exports = {
    pwdCrypto
}